export const launchers = {
    test: () => import("modules/launchers/test.js")
}

export const run = (names) => {
    var keys = names;
    if (names instanceof String) {
        keys = [names];
    }
    var launcher = null;
    for (var i = 0; i < keys.length; i++) {
        launcher = launchers[keys[i]];
        if (launcher) {
            if (launcher instanceof Function) {
                launcher().then(({ default: item }) => {
                	launchers[keys[i]] = item;
                    item.start();
                });
            } else {
                launcher.start();
            }
        }

    }
}

export default {
    launchers,
    run
}